<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.rong.hibernate.Const" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>业务单据录入</title>
		<sx:head />
		<script type="text/javascript" src="js/busi.js"></script>
		<style type="text/css">
@import "css/jquery.datetimeentry.css";
</style>
		<style type="text/css">
@import "css/table.css";
</style>
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/jquery.datetimeentry.js"></script>
		<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
		<script type="text/javascript" src="js/jquery.datetimeentry-zh-CN.js"></script>
		
		<script type="text/javascript" src="js/busi.js"></script>

		<script type="text/javascript">
	
		</script>
	</head>
	<body>
		<p>
			<a href="login.jsp">用户登录</a>
		</p>
		<s:form action="BusiAction.action" theme="simple">
      业务单据|<a href="BusiAction!findall.action">业务单据列表</a>

			<table  cellspacing="0">
				<tr>
					<th style="text-align: right">
						<!--单据编号-->
					</th>
					<td> 
						
						<!--<s:textfield name="busi.num" label="单据编号" /> -->
					</td>
					<th style="text-align: right">
						备注
					</th>
					<td>
						<s:textfield name="busi.remark" label="备注" />
					</td>
				</tr>
				<tr>
					<th style="text-align: right">
						默认吨位
					</th>
					<td>
						<s:textfield name="busi.extAttr2" label="默认吨位" value="%{#session.para.defaultDw}" />  <!-- 扩展属性2被用作默认吨位的保存 -->
					</td>
					<th style="text-align: right">
						误差率
					</th>
					<td>
						<s:textfield name="busi.extAttr1" label="误差率" value="%{#session.para.erroRate}" />%  <!-- 扩展属性1被用作误差率的保存 -->
					</td>
				</tr>
			</table>

			<table  cellspacing="0">
				<tr nowrap>
					<th style="text-align: right">
						采热单号
					</th>
					<td>
						<s:textfield name="busi.heatNum" label="采热单号" />
					</td>

					<th style="text-align: right">
						采热地点
					</th>
					<td>
						<s:select label="选择采热地点" list="#session.company_list"
							name="busi.heatComId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="请选择采热地点" emptyOption="false" />
					</td>

					<th style="text-align: right">
						车辆
					</th>
					<td>
						<s:select label="选择车辆" list="#session.car_list"
							name="busi.heatCarId" listKey="id" listValue="num" headerKey="-1"
							headerValue="请选择车辆" emptyOption="false" />

					</td>
				</tr>

				<tr nowrap>
					<th style="text-align: right">
						采热单价
					</th>
					<td>
						<s:hidden name="busi.heatPriceId" />
						<s:textfield name="busi.heatPrice" label="采热单价" />
					</td>

					<th style="text-align: right">
						单据日期
					</th>
					<td>
						<sx:datetimepicker name="busi.heatDate" displayFormat="yyyy-MM-dd" />
					</td>

					<th style="text-align: right">
						常温水温
					</th>
					<td>
						<s:textfield name="busi.heatWtrCmTept" label="常温水温 " />
					</td>
				</tr>

				<tr nowrap>
					<th style="text-align: right">
						采热成本金额
					</th>
					<td>
						<s:textfield name="busi.heatSum" label="采热成本金额" />
					</td>

					<th style="text-align: right">
						采热时间
					</th>
					<td>
						<input type="text" name="busi.heatTime" class="dtimepaker">
					</td>



					<th style="text-align: right">
						充热水温
					</th>
					<td>
						<s:textfield name="busi.heatWtrAfTept" label="充热水温" />
					</td>
				</tr>
			</table>

			<p>
			是否采水:<s:checkbox label="是否采水" name="busi.waterIs"/>			
			</p>
						
			<table  cellspacing="0">
				<tr nowrap>
					<th style="text-align: right">
						采水单号
					</th>
					<td>
						<s:textfield name="busi.waterNum" label="采水单号" />
					</td>

					<th style="text-align: right">
						采水地点
					</th>
					<td>
						<s:select label="选择采热地点" list="#session.company_list"
							name="busi.waterComId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="请选择采热地点" emptyOption="false" />
					</td>

					<th style="text-align: right">
						选择车辆
					</th>
					<td>
						<s:select label="选择车辆" list="#session.car_list"
							name="busi.waterCarId" listKey="id" listValue="num" headerKey="-1"
							headerValue="请选择车辆" emptyOption="false" />

					</td>

					
				</tr>

				<tr nowrap>
					<th style="text-align: right">
						采水单价
					</th>
					<td>
						<s:hidden name="busi.waterPriceId" />
						<s:textfield name="busi.waterPrice" label="采水单价"  onblur="waterSum_1()" />
					</td>
					
					<th style="text-align: right">
						水表开始读数
					</th>
					<td>
						<s:textfield name="busi.waterMeterStar" label="水表开始读数"  onblur="waterSum_1()"/>
					</td>

					<th style="text-align: right">
					采水单据日期
					</th>
					<td>
						<sx:datetimepicker name="busi.waterDate" displayFormat="yyyy-MM-dd" />
					</td>
				</tr>

				<tr nowrap>
					<th style="text-align: right">
						采水成本金额
					</th>
					<td>
						<s:textfield name="busi.waterSum" label="采水成本金额" onblur="waterSum_1()"/>
					</td>
					
					<th style="text-align: right">
						水表结束读数
					</th>
					<td>
						<s:textfield name="busi.waterMeterEnd" label="水表结束读数"  onblur="waterSum_1()"/>
					</td>
					

					<th style="text-align: right">
						采水时间
					</th>
					<td>
						<!--  <sx:datetimepicker name="busi.waterTime" label="采水时间"  displayFormat="yyyy-MM-dd 24hh:mi"/> -->
						<!--  <s:textfield name="busi.waterTime"  label="采水时间" /> -->
						<input type="text" name="busi.waterTime" class="dtimepaker">
					</td>


				</tr>

				<!-- 
      
         
            <tr>
                   <td style="text-align:right">
                        属性3
                    </td>
                    <td>
                        <s:textfield name="busi.extAttr3" label="属性3" />
                    </td>
          </tr>   
            <tr>
                   <td style="text-align:right">
                        属性4
                    </td>
                    <td>
                        <s:textfield name="busi.extAttr4" label="属性4" />
                    </td>
          </tr>   
              <tr>
                   <td style="text-align:right">
                        属性5
                    </td>
                    <td>
                        <s:textfield name="busi.extAttr5" label="属性5" />
                    </td>
          </tr>   
          -->
			</table>

			<!-- 运费部分 -->
承包方运费结算
           <table id="transTable" class="pill" cellspacing="0">
				<tr>
					<th>
						热源地
					</th>
					<th>
						客户
					</th>
					<th>
						车号
					</th>
					<th nowrap>
						原始单号
						<font color="red">(*)</font>
					</th>
					<th>
						结算方式
					</th>
					<th>
						单价
					</th>
					<th>
						数量
					</th>
					<th>
						金额调整
					</th>
					<th>
						金额
					</th>
					<th>
						里程表起
					</th>
					<th>
						里程表止
					</th>
					<th>
						备注
					</th>
				</tr>

				<tr>
					<td>
						<s:select label="采热地点" list="#session.company_list"
							name="transfList[0].comFromId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="采热地点" emptyOption="false" />
					</td>
					<td>
						<s:select label="采热地点" list="#session.company_list"
							name="transfList[0].comToId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="客户" emptyOption="false" />
					</td>
					<td>
						<s:select label="选择车辆" list="#session.car_list"
							name="transfList[0].carId" listKey="id" listValue="num"
							headerKey="-1" headerValue="车辆" emptyOption="false" />
					</td>
					<td>
						<s:textfield name="transfList[0].tranNum" />
					</td>
					<td>
						<s:select label="结算方式" list="#session.statmap"
							name="transfList[0].stmtStyle" listKey="key" listValue="value"
							headerKey="-1" headerValue="选择结算方式" emptyOption="false" />
						<!--<s:textfield name="transfList[0].stmtStyle"/>-->
					</td>
					<td>
						<s:hidden name="transfList[0].priceId" />
						<s:textfield name="transfList[0].price" />
					</td>
					<td>
						<s:textfield name="transfList[0].amount" />
					</td>
					<td>
						<s:textfield name="transfList[0].sumPlus" />
					</td>
					<td>
						<s:textfield name="transfList[0].sum"  readonly="true"/>
					</td>
					<td>
						<s:textfield name="transfList[0].meterStart" />
					</td>
					<td>
						<s:textfield name="transfList[0].meterEnd" />
					</td>
					<td>
						<s:textfield name="transfList[0].remark" />
					</td>
				</tr>

			</table>
			金额合计：<p id="transfTaltolSum">0.0</p>
			<p>
				<input type="button" value="增加记录" onclick="add()" />
			</p>


			<!--客户销售部分 -->
        客户销售结算
          <table id="sellTable" class="pill" cellspacing="0">
				<tr>
					<th>
						热源地
					</th>
					<th>
						客户
					</th>
					<th>
						车号
					</th>
					<th>
						原始单号
						<font color="red">(*)</font>
					</th>
					<th>
						结算方式
					</th>
					<th>
						单价
					</th>
					<th>
						数量
					</th>
					<th>
						金额调整
					</th>
					<th>
						金额
					</th>
					<th>
						水表起
					</th>
					<th>
						水表止
					</th>
					<th>
						放热时间
					</th>
					<th>
						原水温
					</th>
					<th>
						放热温度
					</th>
					<th>
						备注
					</th>
				</tr>

				<tr>
					<td>
						<s:select label="采热地点" list="#session.company_list"
							name="sellList[0].comFromId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="采热地点" emptyOption="false" />
					</td>
					<td>
						<s:select label="放热地点" list="#session.company_list"
							name="sellList[0].comToId" listKey="id" listValue="comName"
							headerKey="-1" headerValue="客户" emptyOption="false" />
					</td>
					<td>
						<s:select label="车辆" list="#session.car_list"
							name="sellList[0].carId" listKey="id" listValue="num"
							headerKey="-1" headerValue="车辆" emptyOption="false" />
					</td>
					<td>
						<s:textfield name="sellList[0].sellNum" />
					</td>
					<td>
						<s:select label="结算方式" list="#session.statmap"
							name="sellList[0].stmtStyle" listKey="key" listValue="value"
							headerKey="-1" headerValue="选择结算方式" emptyOption="false" />
						<!--<s:textfield name="sellList[0].stmtStyle"/>-->
					</td>
					<td>
						<s:hidden name="sellList[0].priceId" />
						<s:textfield name="sellList[0].price" />
					</td>
					<td>
						<s:textfield name="sellList[0].amount" />
					</td>
					<td>
						<s:textfield name="sellList[0].sumPlus" />
					</td>
					<td>
						<s:textfield name="sellList[0].sum" readonly="true"/>
					</td>
					<td>
						<s:textfield name="sellList[0].meterStart" />
					</td>
					<td>
						<s:textfield name="sellList[0].meterEnd" />
					</td>
					<td>
						<s:textfield name="sellList[0].offerHeatTime" />
					</td>
					<td>
						<s:textfield name="sellList[0].cstmTemptStart" />
					</td>
					<td>
						<s:textfield name="sellList[0].cstmTemptEnd" />
					</td>
					<td>
						<s:textfield name="sellList[0].remark" />
					</td>
				</tr>

			</table>
			金额合计：<p id="sellTaltolSum">0.0</p>
			<p>
				<input type="button" value="增加记录" onclick="addsell()" />
			</p>

			<table  cellspacing="0">
				<tr>
					<td style="text-align: right">
						<s:submit value="保存" />
					</td>
					<td style="text-align: left">
						<s:reset value="取消" />
					</td>

					<td style="text-align: left">
						${busi.num} ${saveFlag}
					</td>

				</tr>
			</table>
		</s:form>
		<s:fielderror cssStyle="color:red" />
	</body>
</html>
